private var preferences:SharedObject;

private function onCreationComplete(): void{
	loadPreferences();
	/*database = File.documentsDirectory.resolvePath("BookManager/projects.db");
	
	if (!database.exists) createDatabaseFile();	
	
	connection = new SQLConnection();
	connection.addEventListener(SQLEvent.OPEN, onDatabaseOpen);
	connection.addEventListener(SQLErrorEvent.ERROR, errorHandler);
	connection.openAsync(database);*/
}

private function loadPreferences():void{
	preferences = SharedObject.getLocal("application-name");
	if (preferences.data.lastProject) loadLastProject(preferences.data.lastProject);
}

private function setLastProject(name:String):void{
	preferences.data.lastProject = name;
}

private function loadLastEditScreen():void{
	if (preferences.data.lastEditScreen){
		
	}
	else{
		main.selectedChild = creationWizard;
	}
	enableNewMenuItems();
}

private function resetPreferences():void{
	preferences.clear();
	main.selectedChild = projectWizard;
}
